package com.tiancheng.trade.settlement.service.settlement;

import com.tiancheng.trade.settlement.exception.BusinessException;
import com.tiancheng.trade.settlement.model.settlement.SettlementBillResult;
import com.tiancheng.trade.settlement.model.settlement.SettlementRule;
import com.tiancheng.trade.settlement.vo.settlement.admin.SettlementBillHandleVO;

import java.util.List;

public interface ISettlementBillService {
    /**
     * 清分对账
     *
     * @param key 唯一key(目前由子订单号+费用类型组成)
     * @return
     */
    List<SettlementBillResult> reconciliation(List<String> key) throws BusinessException;

    /**
     * 保存我方有银行无的差异数据
     *
     * @return
     */
    void saveBankNothingException() throws BusinessException;

    /**
     * 保存我方有银行无的差异数据
     *
     * @return
     */
    int polling() throws BusinessException;

    /**
     * 保存对账结果，更新待对账数据的状态
     *
     * @param list
     * @param key
     * @return
     */
    void saveResult(List<SettlementBillResult> list, List<String> key) throws BusinessException;

    /**
     * 匹配清分规则后重新对账
     *
     * @param key
     * @param rule
     * @return
     */
    void matchingRuleReconciliation(List<String> key, SettlementRule rule) throws BusinessException;


    /**
     * 批理备注
     *
     * @param vo
     * @return
     * @throws BusinessException
     */
    int audit(SettlementBillHandleVO vo) throws BusinessException;

    /**
     * 保存老系统子订单号为空的数据
     */
    void saveBankSubOrderIsNullData();

    void updateErrorAmount(List<String> subOrderKeys);
}
